{% set metric_host = hostvars[groups.prometheus_servers[0]].ansible_host | default(hostvars[groups.prometheus_servers[0]].inventory_hostname) if groups.prometheus_servers else "" -%}
{% set metric_port = hostvars[groups.prometheus_servers[0]].prometheus_port if groups.prometheus_servers else ''-%}
{
    "name":"{{ cluster_name }}",
    "type":"prometheus",
    "access":"proxy",
    "url":"http://{{ metric_host }}:{{ metric_port }}/",
    "basicAuth":false
}